package com.base.core.model;


/**
 * 邮件服务
 * @author win10
 */
public class EmailData {

    /**
     * 收件人邮箱
     */
    private String to;

    /**
     * 主题
     */
    private String subject;

    /**
     * 内容
     */
    private String content;


    private String templateDir;

    public EmailData() {
    }

    private EmailData (Builder builder) {
        this.to = builder.to;
        this.subject = builder.subject;
        this.content = builder.content;
        this.templateDir = builder.templateDir;
    }


    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTemplateDir() {
        return templateDir;
    }

    public void setTemplateDir(String templateDir) {
        this.templateDir = templateDir;
    }

    public static class Builder {
        private String to;
        private String subject;
        private String content;
        private String templateDir;

        public Builder setTo(String to) {
            this.to = to;
            return this;
        }

        public Builder setSubject(String subject) {
            this.subject = subject;
            return this;
        }

        public Builder setContent(String content) {
            this.content = content;
            return this;
        }

        public Builder setTemplateDir(String templateDir) {
            this.templateDir = templateDir;
            return this;
        }

        public EmailData build() {
            return new EmailData(this);
        }
    }

    @Override
    public String toString() {
        return "EmailData{" +
                "to='" + to + '\'' +
                ", subject='" + subject + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
